/*
 * @Author: geyulan 18500325526@163.com
 * @Date: 2020-04-26 10:56:12
 * @LastEditors: geyulan 18500325526@163.com
 * @LastEditTime: 2023-12-12 14:45:36
 * @FilePath: /coupon-laxin/src/main.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
/* eslint-disable */
import Vue from 'vue'
import App from './App'
import router from './router'
import common from './mixin/common.js'
// import Toast from '@/plugins/toast/ShowToast'
import { pageLoading, moreLoading } from '@/plugins/loading/index'
import { Form, Field, Button, Switch, Loading, Checkbox, CheckboxGroup, SubmitBar, Search, Icon, RadioGroup, Radio, Popup, List, Cell, Empty, Notify, Picker } from 'vant'
import 'babel-polyfill'
// import Vconsole from 'vconsole'
// let vConsole = new Vconsole()
// Vue.use(vConsole)
Vue.use(Form).use(Field).use(Button).use(Switch).use(Loading).use(Checkbox).use(CheckboxGroup).use(SubmitBar).use(Search).use(Icon).use(RadioGroup).use(Radio).use(Popup).use(List).use(Cell).use(Empty).use(Notify).use(Picker)
Vue.config.productionTip = false
Vue.component(pageLoading.name, pageLoading)
Vue.component(moreLoading.name, moreLoading)
Vue.mixin(common)
// Vue.use(Toast)
router.beforeEach((to, from, next) => {
  /* 路由发生变化修改页面title */
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})
/* eslint-disable */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
/*
** 寻找祖先元素
*/
HTMLElement.prototype.parents = function (p) {
  var target,
    t = this
  while ((t = t.parentNode) && t.nodeType !== 9) {
    if (t.nodeType === 1) {
      if (t.tagName.toLowerCase() === p) {
        target = t
        break
      } else if (
        p.startsWith('.') &&
        t.classList.contains(p.replace(/\./, ''))
      ) {
        target = t
        break
      } else if (p.startsWith('#') && '#' + t.id === p) {
        target = t
        break
      }
    }
  }
  return target
}